#include <bits/stdc++.h>

#define in read()
#define fi first
#define se second
#define pb push_back

using namespace std;

typedef pair < int , int > pii;
typedef vector < int > vec;
typedef vector < pii > veg;
typedef long long ll;
typedef double db;

int read() {
    int x = 0; bool f = 0; char ch = getchar(); while(!isdigit(ch)) f |= ch =='-',ch = getchar();
    while(isdigit(ch)) x = x * 10 + (ch ^ 48),ch = getchar(); return f ? -x : x;
}

const int N = 1e5 + 10;

int rt,ch[N][2],id[N],K,n;
ll x[N],y[N],L[N],R[N],U[N],D[N];

priority_queue < ll , vector < ll > , greater < ll > > q;

inline ll sq(ll x) { return x * x; }

void pushup(int p) {
    L[p] = R[p] = x[id[p]]; U[p] = D[p] = y[id[p]];
    if(ch[p][0]) {
	L[p] = min(L[p],L[ch[p][0]]); R[p] = max(R[p],R[ch[p][0]]);
	D[p] = min(D[p],D[ch[p][0]]); U[p] = max(U[p],U[ch[p][0]]);
    }
    if(ch[p][1]) {
	L[p] = min(L[p],L[ch[p][1]]); R[p] = max(R[p],R[ch[p][1]]);
	D[p] = min(D[p],D[ch[p][1]]); U[p] = max(U[p],U[ch[p][1]]);
    }
}

int build(int l,int r) {
    if(l > r) return 0; int mid = l + r >> 1; db sx = 0,sy = 0;
    for(int i = l;i <= r;i++) sx += x[id[i]],sy += y[id[i]];
    sx /= (r - l + 1); sy /= (r - l + 1);
    db dx = 0,dy = 0;
    for(int i = l;i <= r;i++) dx += (x[id[i]] - sx) * (x[id[i]] - sx),dy += (y[id[i]] - sy) * (y[id[i]] - sy);
    if(dx > dy) nth_element(id + l,id + mid,id + r + 1,[](int a,int b) { return x[a] < x[b]; });
    else nth_element(id + l,id + mid,id + r + 1,[](int a,int b) { return y[a] < y[b]; });
    ch[mid][0] = build(l,mid - 1); ch[mid][1] = build(mid + 1,r); pushup(mid); return mid; 
}

void query(int l,int r,int p) {
    if(l > r) return; int mid = l + r >> 1;
    ll d = sq(x[id[p]] - x[id[mid]]) + sq(y[id[p]] - y[id[mid]]); if(d > q.top()) q.pop(),q.push(d); 
    ll disl = max(sq(L[ch[mid][0]] - x[id[p]]),sq(R[ch[mid][0]] - x[id[p]])) + max(sq(U[ch[mid][0]] - y[id[p]]),sq(D[ch[mid][0]] - y[id[p]]));
    ll disr = max(sq(L[ch[mid][1]] - x[id[p]]),sq(R[ch[mid][1]] - x[id[p]])) + max(sq(U[ch[mid][1]] - y[id[p]]),sq(D[ch[mid][1]] - y[id[p]]));
    if(disl > q.top() && disr > q.top()) {
	if(disl > disr) {
	    query(l,mid - 1,p);
	    if(disr > q.top()) query(mid + 1,r,p);
	} else {
	    query(mid + 1,r,p);
	    if(disl > q.top()) query(l,mid - 1,p);
	}
    } else {
	if(disl > q.top()) query(l,mid - 1,p);
	if(disr > q.top()) query(mid + 1,r,p);
    }
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("1.in","r",stdin);
#endif
    n = in,K = in; K *= 2;
    for(int i = 1;i <= n;i++) x[i] = in,y[i] = in,id[i] = i;
    build(1,n); for(int i = 1;i <= K;i++) q.push(0);
    for(int i = 1;i <= n;i++) query(1,n,i); printf("%lld\n",q.top()); return 0;
}
